package com.zs.utils;



import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Properties;

/**
 * @author ZhouShuang
 * @version 17
 * @Title
 * @date 2025/6/11 下午5:27
 */
public class FrameWork {
    private static final String classPath ;
    private static final String methodName ;

    static {
        Properties properties = new Properties();
        try{
            properties.load(FrameWork.class.getResourceAsStream("/application.properties"));
            classPath = properties.getProperty("classPath");
            methodName = properties.getProperty("methodName");
        }catch (IOException e){
            throw new RuntimeException(e);
        }
    }

    public static Object loadClass() throws Exception{
        Class<?> clazz = Class.forName(classPath);
        return clazz.getConstructor(String.class,String.class,String.class,double.class).newInstance("JD01","张潇然","java开发工程师",50000.0);
    }

    public static void execute() throws Exception{
        Object object = loadClass();
        Method method = object.getClass().getDeclaredMethod(methodName);
        method.invoke(object);
    }

    public static void main(String [] args) throws Exception{
        execute();
    }
}
